﻿<ribbon:RibbonWindow  x:Class="Hisaab.Windows.Client.RibbonMainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
        xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
        xmlns:ViewModel="clr-namespace:Hisaab.Windows.Client.ViewModel" xmlns:RibbonWrapper="clr-namespace:Hisaab.Windows.RibbonWrapper;assembly=Hisaab.Windows.RibbonWrapper" xmlns:Model="clr-namespace:Hisaab.Windows.Client.Model" Title="{Binding Title}" Height="584" Width="1029"
        Icon="{StaticResource ApplicationIcon}" >
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <ribbon:Ribbon Name="mainRibbon">
            <ribbon:Ribbon.ApplicationMenu>
                <ribbon:RibbonApplicationMenu KeyTip="F" >
                    <ribbon:RibbonApplicationMenuItem Style="{StaticResource NewButton}" >
                        <ribbon:RibbonApplicationMenuItem Style="{StaticResource NewExpanse}" Command="{Binding Path=NewTransactionCommand}"  />
                        <ribbon:RibbonApplicationMenuItem Style="{StaticResource NewVehicleTransaction}" Command="{Binding Path=NewVehicleTransactionCommand}"/>
                        <ribbon:RibbonSeparator />
                        <ribbon:RibbonApplicationMenuItem Style="{StaticResource NewTag}"               Command="{Binding Path=NewTagCommand}"/>
                        <ribbon:RibbonApplicationMenuItem Style="{StaticResource NewAccount}"           Command="{Binding Path=NewAccountCommand}"/>
                        <ribbon:RibbonApplicationMenuItem Style="{StaticResource NewVehicle}"           Command="{Binding Path=NewVehicleCommand}"/>
                    </ribbon:RibbonApplicationMenuItem>
                    <ribbon:RibbonApplicationMenuItem Style="{StaticResource SaveButton}" KeyTip="S" Command="{x:Static ViewModel:MainWindowViewModel.SaveCommand}" />
                    <ribbon:RibbonSeparator />
                    <ribbon:RibbonApplicationMenuItem Style="{StaticResource ImportButton}" >
                        <ribbon:RibbonApplicationMenuItem Style="{StaticResource ImportNatwestButton}" />
                        <ribbon:RibbonApplicationMenuItem Style="{StaticResource ImportHsbcButton}" />
                    </ribbon:RibbonApplicationMenuItem>
                    <ribbon:RibbonApplicationMenuItem Style="{StaticResource ExportButton}" >
                        <ribbon:RibbonApplicationMenuItem Style="{StaticResource ExportFileButton}" />
                    </ribbon:RibbonApplicationMenuItem>
                    <ribbon:RibbonApplicationMenuItem Style="{StaticResource BackupButton}" KeyTip="B" Command="{Binding Path=BackupCommand}" />
                    <ribbon:RibbonApplicationMenuItem Style="{StaticResource RestoreButton}" KeyTip="I" Command="{Binding Path=ResotreCommand}" />
                    <ribbon:RibbonSeparator />
                    <ribbon:RibbonApplicationMenuItem Style="{StaticResource OptionButton}" Command="{Binding Path=OptionsCommand}" />
                    <ribbon:RibbonSeparator />
                    <ribbon:RibbonApplicationMenuItem Style="{StaticResource AboutButton}" Command="{Binding Path=AboutCommand}" />

                    <ribbon:RibbonApplicationMenu.FooterPaneContent>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <ribbon:RibbonButton Grid.Column="2" Style="{StaticResource ExitButton}" Command="{Binding ExitCommand}" />
                        </Grid>
                    </ribbon:RibbonApplicationMenu.FooterPaneContent>
                </ribbon:RibbonApplicationMenu>
            </ribbon:Ribbon.ApplicationMenu>
            <ribbon:Ribbon.QuickAccessToolBar>
                <ribbon:RibbonQuickAccessToolBar>
                    <ribbon:RibbonButton Style="{StaticResource SaveSmallButton}" Command="{x:Static ViewModel:MainWindowViewModel.SaveCommand}" />
                    <ribbon:RibbonButton Style="{StaticResource PasteButton}" />
                    <ribbon:RibbonButton Style="{StaticResource CutButton}" />
                    <ribbon:RibbonButton Style="{StaticResource CopyButton}" />
                </ribbon:RibbonQuickAccessToolBar>
            </ribbon:Ribbon.QuickAccessToolBar>
            <ribbon:RibbonTab Header="Home" KeyTip="H" >
                <ribbon:RibbonGroup Style="{StaticResource DashboardGroup}" >
                    <ribbon:RibbonButton Style="{StaticResource OpenDashboardButton}"            Command="{Binding Path=OpenDashboardCommand}" />
                </ribbon:RibbonGroup>
                <ribbon:RibbonGroup Style="{StaticResource NewGroup}" >
                    <ribbon:RibbonButton Style="{StaticResource AddTransaction}"            Command="{Binding Path=NewTransactionCommand}" />
                    <ribbon:RibbonButton Style="{StaticResource AddVehicleTransaction}"     Command="{Binding Path=NewVehicleTransactionCommand}" />
                    <ribbon:RibbonButton Style="{StaticResource AddTagButton}"              Command="{Binding Path=NewTagCommand}" />
                    <ribbon:RibbonButton Style="{StaticResource AddAccountButton}"          Command="{Binding Path=NewAccountCommand}" />
                    <ribbon:RibbonButton Style="{StaticResource AddVehicleButton}"          Command="{Binding Path=NewVehicleCommand}" />
                </ribbon:RibbonGroup>
                <ribbon:RibbonGroup Style="{StaticResource ToolsGroup}">
                    <ribbon:RibbonButton Style="{StaticResource CalculatorButton}"          Command="{Binding Path=OpenCalculatorCommand}"/>
                </ribbon:RibbonGroup>
            </ribbon:RibbonTab>
            <ribbon:RibbonTab Header="View" KeyTip="V" >
                <ribbon:RibbonGroup Style="{StaticResource ViewsGroup}" >
                    <ribbon:RibbonButton Style="{StaticResource TransactionsButton}"        Command="{Binding Path=OpenTransactionsCommand}" />
                    <ribbon:RibbonButton Style="{StaticResource VehicleTransactionsButton}" Command="{Binding Path=OpenVehicleTransactionsCommand}" />
                    <ribbon:RibbonButton Style="{StaticResource TagsButton}"                Command="{Binding Path=OpenTagsCommand}" />
                    <ribbon:RibbonButton Style="{StaticResource AccountsButton}"            Command="{Binding Path=OpenAccountsCommand}" />
                    <ribbon:RibbonButton Style="{StaticResource VehiclesButton}"            Command="{Binding Path=OpenVehiclesCommand}" />
                </ribbon:RibbonGroup>
            </ribbon:RibbonTab>

            <ribbon:RibbonTab x:Name="AccountTab" ContextualTabGroupHeader="Account" Header="Accounts">
                <ribbon:RibbonGroup x:Name="AccountTabGroup" >
                    <ribbon:RibbonButton Style="{StaticResource AddAccountButton}"          Command="{Binding Path=NewAccountCommand}" />
                    <ribbon:RibbonButton Style="{StaticResource RefreshAccountButton}"      Command="{x:Static ViewModel:AccountsViewModel.RefreshCommand}"/>
                    <ribbon:RibbonButton Style="{StaticResource EditAccountButton}"         Command="{x:Static ViewModel:AccountsViewModel.EditCommand}"/>
                    <ribbon:RibbonButton Style="{StaticResource DeleteAccountButton}"       Command="{x:Static ViewModel:AccountsViewModel.DeleteCommand}"/>
                </ribbon:RibbonGroup>
            </ribbon:RibbonTab>
            <ribbon:RibbonTab x:Name="TagTab" ContextualTabGroupHeader="Tag" Header="Tag">
                <ribbon:RibbonGroup x:Name="TagTabGroup" >
                    <ribbon:RibbonButton Style="{StaticResource AddTagButton}"              Command="{Binding Path=NewTagCommand}" />
                    <ribbon:RibbonButton Style="{StaticResource RefreshTagButton}"          Command="{x:Static ViewModel:TagsViewModel.RefreshCommand}"/>
                    <ribbon:RibbonButton Style="{StaticResource EditTagButton}"             Command="{x:Static ViewModel:TagsViewModel.EditCommand}" />
                    <ribbon:RibbonButton Style="{StaticResource DeleteTagButton}"           Command="{x:Static ViewModel:TagsViewModel.DeleteCommand}"/>
                </ribbon:RibbonGroup>
            </ribbon:RibbonTab>
            <ribbon:RibbonTab x:Name="TransactionTab" ContextualTabGroupHeader="Transaction" Header="Transaction">
                <ribbon:RibbonGroup x:Name="TransactionTabGroup" Header="Actions">
                    <ribbon:RibbonButton Style="{StaticResource AddTransaction}"            Command="{Binding Path=NewTransactionCommand}" />
                    <ribbon:RibbonButton Style="{StaticResource RelateTransaction}"         Command="{x:Static ViewModel:TransactionsViewModel.RelateTransactionCommand}" />
                    <ribbon:RibbonButton Style="{StaticResource RefreshTransactionButton}"  Command="{x:Static ViewModel:TransactionsViewModel.RefreshCommand}"/>
                    <ribbon:RibbonButton Style="{StaticResource EditTransactionButton}"     Command="{x:Static ViewModel:TransactionsViewModel.EditCommand}"/>
                    <ribbon:RibbonButton Style="{StaticResource DeleteTransactionButton}"   Command="{x:Static ViewModel:TransactionsViewModel.DeleteCommand}"/>
                </ribbon:RibbonGroup>
                <ribbon:RibbonGroup x:Name="TransactionFilterTabGroup" Header="Filter" >
                    <ribbon:RibbonMenuButton Label="Account" ItemsSource="{Binding Accounts}" DisplayMemberPath="Name" LargeImageSource="/Images/Large/account_filter.png">
                        <ribbon:RibbonMenuButton.ItemContainerStyle>
                            <Style TargetType="ribbon:RibbonMenuItem">
                                <Setter Property="Command" Value="{x:Static ViewModel:TransactionsViewModel.FilterAccountCommand}" />
                                <Setter Property="CommandParameter" Value="{Binding AccountId }" />
                                <Setter Property="IsCheckable" Value="True" />
                                <Setter Property="RibbonWrapper:MenuItemExtensions.GroupName" Value="TransactionAccountsGroup" />
                            </Style>
                        </ribbon:RibbonMenuButton.ItemContainerStyle>
                    </ribbon:RibbonMenuButton>
                    <ribbon:RibbonMenuButton Label="For Period" LargeImageSource="/Images/Large/Calendar.png">
                        <ribbon:RibbonMenuButton.Items>
                            <ribbon:RibbonMenuItem Header="Current Month" IsCheckable="True" IsChecked="True" Command="{x:Static ViewModel:TransactionsViewModel.ByMonthCommand}" CommandParameter="0" RibbonWrapper:MenuItemExtensions.GroupName="TransactionCalenderGroup"/>
                            <ribbon:RibbonSeparator />
                            <ribbon:RibbonMenuItem Header="Last 1 Month"    IsCheckable="True" Command="{x:Static ViewModel:TransactionsViewModel.ByMonthCommand}" CommandParameter="1" RibbonWrapper:MenuItemExtensions.GroupName="TransactionCalenderGroup"/>
                            <ribbon:RibbonMenuItem Header="Last 2 Months"   IsCheckable="True" Command="{x:Static ViewModel:TransactionsViewModel.ByMonthCommand}" CommandParameter="2" RibbonWrapper:MenuItemExtensions.GroupName="TransactionCalenderGroup"/>
                            <ribbon:RibbonMenuItem Header="Last 3 Months"   IsCheckable="True" Command="{x:Static ViewModel:TransactionsViewModel.ByMonthCommand}" CommandParameter="3" RibbonWrapper:MenuItemExtensions.GroupName="TransactionCalenderGroup"/>
                            <ribbon:RibbonMenuItem Header="Last 4 Months"   IsCheckable="True" Command="{x:Static ViewModel:TransactionsViewModel.ByMonthCommand}" CommandParameter="4" RibbonWrapper:MenuItemExtensions.GroupName="TransactionCalenderGroup"/>
                            <ribbon:RibbonMenuItem Header="Last 5 Months"   IsCheckable="True" Command="{x:Static ViewModel:TransactionsViewModel.ByMonthCommand}" CommandParameter="5" RibbonWrapper:MenuItemExtensions.GroupName="TransactionCalenderGroup"/>
                            <ribbon:RibbonMenuItem Header="Last 6 Months"   IsCheckable="True" Command="{x:Static ViewModel:TransactionsViewModel.ByMonthCommand}" CommandParameter="6" RibbonWrapper:MenuItemExtensions.GroupName="TransactionCalenderGroup"/>
                            <ribbon:RibbonMenuItem Header="Last 12 Months"  IsCheckable="True" Command="{x:Static ViewModel:TransactionsViewModel.ByMonthCommand}" CommandParameter="12" RibbonWrapper:MenuItemExtensions.GroupName="TransactionCalenderGroup"/>
                            <ribbon:RibbonSeparator />
                            <ribbon:RibbonMenuItem Header="All" IsCheckable="True" Command="{x:Static ViewModel:TransactionsViewModel.ByMonthCommand}" CommandParameter="-1" RibbonWrapper:MenuItemExtensions.GroupName="TransactionCalenderGroup"/>
                        </ribbon:RibbonMenuButton.Items>
                    </ribbon:RibbonMenuButton>
                    <ribbon:RibbonMenuButton Label="Filter By" LargeImageSource="/Images/Large/Filter.png" SmallImageSource="/Images/Small/Filter.png">
                        <ribbon:RibbonMenuButton.Items>
                            <ribbon:RibbonMenuItem Header="Date" IsCheckable="True" IsChecked="True" Command="{x:Static ViewModel:TransactionsViewModel.SortCommand}" CommandParameter="{x:Static Model:SortByType.Date}" RibbonWrapper:MenuItemExtensions.GroupName="TransactionSortingGroup"/>
                            <ribbon:RibbonMenuItem Header="Amount" IsCheckable="True" Command="{x:Static ViewModel:TransactionsViewModel.SortCommand}" CommandParameter="{x:Static Model:SortByType.Amount}" RibbonWrapper:MenuItemExtensions.GroupName="TransactionSortingGroup"/>
                            <ribbon:RibbonMenuItem Header="Transaction Type" IsCheckable="True" Command="{x:Static ViewModel:TransactionsViewModel.SortCommand}" CommandParameter="{x:Static Model:SortByType.Type}" RibbonWrapper:MenuItemExtensions.GroupName="TransactionSortingGroup"/>
                            <ribbon:RibbonSeparator />
                            <ribbon:RibbonMenuItem Header="Ascending" IsCheckable="True" IsChecked="True" Command="{x:Static ViewModel:TransactionsViewModel.OrderByCommand}" CommandParameter="{x:Static Model:OrderByType.Ascending}" RibbonWrapper:MenuItemExtensions.GroupName="TransactionOrderGroup"/>
                            <ribbon:RibbonMenuItem Header="Descending" IsCheckable="True" Command="{x:Static ViewModel:TransactionsViewModel.OrderByCommand}" CommandParameter="{x:Static Model:OrderByType.Descending}" RibbonWrapper:MenuItemExtensions.GroupName="TransactionOrderGroup"/>
                        </ribbon:RibbonMenuButton.Items>
                    </ribbon:RibbonMenuButton>
                </ribbon:RibbonGroup>
            </ribbon:RibbonTab>
            <ribbon:RibbonTab x:Name="VehicleTransactionTab" ContextualTabGroupHeader="VehicleTransaction" Header="Vehicle Transaction">
                <ribbon:RibbonGroup x:Name="VehicleTransactionTabGroup" >
                    <ribbon:RibbonButton Style="{StaticResource AddVehicleTransaction}"     Command="{Binding Path=NewVehicleTransactionCommand}" />
                    <ribbon:RibbonButton Style="{StaticResource RefreshVehicleTransactionButton}" Command="{x:Static ViewModel:VehicleTransactionsViewModel.RefreshCommand}"/>
                    <ribbon:RibbonButton Style="{StaticResource EditVehicleTransactionButton}"    Command="{x:Static ViewModel:VehicleTransactionsViewModel.EditCommand}" />
                    <ribbon:RibbonButton Style="{StaticResource DeleteVehicleTransactionButton}"  Command="{x:Static ViewModel:VehicleTransactionsViewModel.DeleteCommand}"/>
                </ribbon:RibbonGroup>
            </ribbon:RibbonTab>
            <ribbon:RibbonTab x:Name="VehicleTab" ContextualTabGroupHeader="Vehicle" Header="Vehicle">
                <ribbon:RibbonGroup x:Name="VehicleTabGroup" >
                    <ribbon:RibbonButton Style="{StaticResource AddVehicleButton}"          Command="{Binding Path=NewVehicleCommand}" />
                    <ribbon:RibbonButton Style="{StaticResource RefreshVehicleButton}" Command="{x:Static ViewModel:VehiclesViewModel.RefreshCommand}"/>
                    <ribbon:RibbonButton Style="{StaticResource EditVehicleButton}"         Command="{x:Static ViewModel:VehiclesViewModel.EditCommand}" />
                    <ribbon:RibbonButton Style="{StaticResource DeleteVehicleButton}"       Command="{x:Static ViewModel:VehiclesViewModel.DeleteCommand}"/>
                </ribbon:RibbonGroup>
            </ribbon:RibbonTab>
            <ribbon:Ribbon.ContextualTabGroups>
                <ribbon:RibbonContextualTabGroup Name="cmAccount" Header="Account" Visibility="Hidden"  Background="Green" />
                <ribbon:RibbonContextualTabGroup Name="cmTag" Header="Tag" Visibility="Hidden"  Background="DarkBlue" />
                <ribbon:RibbonContextualTabGroup Name="cmTransaction" Header="Transaction" Visibility="Hidden"  Background="Chocolate" />
                <ribbon:RibbonContextualTabGroup Name="cmVehicle" Header="Vehicle" Visibility="Hidden"  Background="DeepPink" />
                <ribbon:RibbonContextualTabGroup Name="cmVehicleTransaction" Header="VehicleTransaction" Visibility="Hidden"  Background="DeepSkyBlue" />
            </ribbon:Ribbon.ContextualTabGroups>
        </ribbon:Ribbon>
        <ad:DockingManager x:Name="dockManager" Grid.Row="1">
            <ad:DocumentPane x:Name="mainDocumentHost" />
        </ad:DockingManager>
        <StatusBar Grid.Row="2" Height="25" BorderBrush="#FFCCD9E7">
            <StatusBar.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFFDFEFE" Offset="0.264" />
                    <GradientStop Color="#FFC1D2EE" Offset="1" />
                    <GradientStop Color="#FFEDF3F9" Offset="0.289" />
                </LinearGradientBrush>
            </StatusBar.Background>
            <StatusBar.Items>
                <StatusBarItem  Content="Ready"/>
            </StatusBar.Items>
        </StatusBar>
    </Grid>
</ribbon:RibbonWindow >